<template>
  <h1>单选组件</h1>
  <el-radio-group v-model="edu">
    <el-radio label="学历：专科" value="zk"></el-radio>
    <el-radio label="学历：本科" value="bk"></el-radio>
    <el-radio label="学历：硕士" value="ss"></el-radio>
    <el-radio label="学历：博士" value="bs"></el-radio>
  </el-radio-group>
  <h4>您选择的结果是：{{ edu }}</h4>
  <hr>
  <el-radio-group v-model="res">
    <el-radio v-for="item in arr" :label="item.level" :value="item.value"></el-radio>
  </el-radio-group>
  <h4>您选择的结果是：{{ res }}</h4>
</template>

<script setup>
import {ref} from "vue";

const edu = ref('bk')
// 定义数组用来模拟从后端查出来的数据
const arr = ref([
  {level: '员工', value: 10},
  {level: '经理', value: 20},
  {level: '总监', value: 30},
  {level: '总裁', value: 40}
])
const res = ref('');
</script>

<style scoped>

</style>